<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    {% if post %}
    <meta name="title" content="{{ post.title }} | {{ blog_meta.name }}">
    <meta name="description" content="{{ post.abstract }}">
    <meta name="author" content="{{ post.author.username }}">
    <meta name="keywords" content="{{ post.tags|join(',') }}">
    {% else %}
    <meta name="title" content="{{ blog_meta.name }}">
    <meta name="description" content="{{ blog_meta.description }}">
    <meta name="author" content="{{ blog_meta.owner }}">
    <meta name="keywords" content="{{ blog_meta.keywords }}">
    {% endif %}

    <meta name="google-site-verification" content="{{ blog_meta.google_site_verification }}">
    <meta name="baidu-site-verification" content="{{ blog_meta.baidu_site_verification }}">
    <meta name="sogou_site_verification" content="{{ blog_meta.sogou_site_verification }}"/>
    <meta name="sogou-site-verification" content="{{ blog_meta.sogou_site_verification }}"/>

    <title>{% block title %}Oct Blog{% endblock %}</title>

    <!-- Bootstrap Core CSS -->

    <link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='img/favicon-32x32.png') }}">
    <link rel="icon" type="image/png" sizes="96x96" href="{{ url_for('static', filename='img/favicon-96x96.png') }}">
    <link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='img/favicon-16x16.png') }}">

    <!-- <link href="http://cdn.staticfile.org/twitter-bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.staticfile.org/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="{{ url_for('static', filename='css/clean-blog.css') }}" rel="stylesheet">
    <!-- <link rel="stylesheet" href="//cdn.bootcss.com/startbootstrap-clean-blog/3.3.7/css/clean-blog.min.css"> -->
    <link href="{{ url_for('static', filename='css/octblog.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css">

    <link href="{{ url_for('main.recent_feed') }}"
      rel="alternate"
      title="Recent Changes" 
      type="application/atom+xml">

    {% block custom_head %}{% endblock %}

    <style> html{display : none ; } </style> 
    <script>
    if( self == top ) {
              document.documentElement.style.display = 'block' ;
       } else {
           top.location = self.location ;
       }
    </script>

    {% if allow_daovoice %}
    <script>(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/3de6f25e.js","daovoice")</script>
    {% endif %}

    <!-- Custom Fonts -->
    <!-- <link href="http://libs.useso.com/js/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-custom navbar-fixed-top">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header page-scroll">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{ url_for('main.index') }}">Oct Blog</a> 
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="{{ url_for('main.recent_feed') }}" target="_blank">RSS</i></a>
                    </li>
                    <li>
                        <a href="{{ url_for('main.archive') }}">Archive</i></a>
                    </li>

                   
                    {% for page in pages %}
                    <li>
                        <a href="{{ url_for('main.page_detail', slug=page.slug) }}">{{ page.slug }}</a>
                    </li>
                    {% endfor %}

                    <li>
                        {% if current_user.is_authenticated %}
                        <a href="{{ url_for('blog_admin.index') }}">{{ current_user.username }}</i></a>
                        {% endif %}
                    </li>
                    
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>
    <!-- Page Header -->
    <!-- Set your background image for this header on the line below. -->
    {%block header %}{% endblock %}
    <!-- Main Content -->
    {%block main %}{% endblock %}
    <!-- Footer -->
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                    <ul class="list-inline text-center">
                        <li>
                            <a href="https://creativecommons.org/licenses/" target="_blank">
                                <span class="fa-stack fa-lg">
                                    <i class="fa fa-circle fa-stack-2x"></i>
                                    <i class="fa fa-creative-commons fa-stack-1x fa-inverse"></i>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a href="{{ url_for('main.recent_feed') }}">
                                <span class="fa-stack fa-lg">
                                    <i class="fa fa-circle fa-stack-2x"></i>
                                    <i class="fa fa-rss fa-stack-1x fa-inverse"></i>
                                </span>
                            </a>
                        </li>
                        <li>
                            <a href="https://github.com/flyhigher139/OctBlog" target="_blank">
                                <span class="fa-stack fa-lg">
                                    <i class="fa fa-circle fa-stack-2x"></i>
                                    <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                                </span>
                            </a>
                        </li>
                    </ul>
                    <p class="copyright text-muted">Copyright &copy; Oct Blog 2015</p>
                    <p class="copyright text-muted"><a href="http://www.qiniu.com" target="_blank" ><img src="{{ qiniu }}"></a></p>
                </div>
            </div>
        </div>
    </footer>
    <!-- jQuery -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <!-- Custom Theme JavaScript -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    
    {% if allow_daovoice %}
        {% if current_user.is_authenticated %}
            <script type="text/javascript">
                  daovoice('init', {
                  app_id: "{{ dao_app_id }}",
                  user_id: "{{ current_user.username }}", // 必填: 该用户在您系统上的唯一ID
                  email: "{{ current_user.email }}", // 选填:  该用户在您系统上的主邮箱
                  name: "{{ current_user.username }}", // 选填: 用户名
                  signed_up: {{ current_user.create_time.strftime("%s") }} // 选填: 用户的注册时间，用Unix时间戳表示
                });
                daovoice('update');
            </script>

        {% else %}
            <script type="text/javascript">
                daovoice('init', {
                  app_id: "{{ dao_app_id }}"
                });
                daovoice('update');
            </script>

        {% endif %}
    {% endif %}


    {% block js %}
    {% endblock %}
</body>
</html>